package com.qianfeng.smartdevice.mapper;

import com.qianfeng.smartdevice.pojo.SysUserInfo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @time: 2022-03-14 17:05
 */
public interface SysUserInfoMapper {

    @Select("SELECT * FROM sys_user_info WHERE u_id=#{userId}")
    SysUserInfo findById(Long userId);

    @Select("SELECT * FROM sys_user_info")
    List<SysUserInfo> findAll();

    void addUser(SysUserInfo sysUserInfo);


    @Select("SELECT * FROM sys_user_info WHERE username=#{username}")
    SysUserInfo findByUsername(String username);

    @Select("SELECT * FROM sys_user_info WHERE phone=#{phonenum}")
    SysUserInfo findByPhone(String phonenum);

    @Select("SELECT * FROM sys_user_info WHERE email=#{email}")
    SysUserInfo findByEmail(String email);

}
